package com.lichuang.fruitvarietysm.order.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lichuang.fruitvarietysm.order.entity.UserOrder;
import com.lichuang.fruitvarietysm.order.mapper.UserOrderMapper;
import com.lichuang.fruitvarietysm.order.service.IUserOrderService;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 * 订单表 服务实现类
 * </p>
 *
 * @author shuaihang
 * @since 2019-06-17
 */
@Service
public class UserOrderServiceImpl extends ServiceImpl<UserOrderMapper, UserOrder> implements IUserOrderService {

    @Override
    public IPage<UserOrder> getOrder(Page page, UserOrder order) {
        return baseMapper.getOrder(page, order);
    }

    @Override
    public int updateUserOrderById(UserOrder userOrder) {
        userOrder.setUpdateTime(LocalDateTime.now());
        return baseMapper.updateById(userOrder);
    }
}
